﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MDF
{
    class FileManage
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public FileManage()
        {

        }
        /// <summary>
        /// 创建默认文件夹
        /// </summary>
        public static void CreateFileFolder()
        {
            try
            {
                //创建一个Bin文件夹，存放配置文件
                if (!Directory.Exists(Application.StartupPath+"\\Sys"))
                {
                    Directory.CreateDirectory(Application.StartupPath + "\\Sys");
                }
                //创建一个Source文件夹，存放默认数据源
                if (!Directory.Exists(Application.StartupPath+"\\Source"))
                {
                    Directory.CreateDirectory(Application.StartupPath + "\\Source");
                }
                //创建一个Data文件夹，存放数据文件
                if (!Directory.Exists(Application.StartupPath + "\\Data"))
                {
                    Directory.CreateDirectory(Application.StartupPath + "\\Data");
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 判断文件是否存在
        /// </summary>
        /// <param name="filePath"></param>
        public static bool FileIsExists(string filePath)
        {
            try
            {
                if (File.Exists(filePath))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 获取树节点所需的信息
        /// </summary>
        public void TreeNodesInfo()
        {
            try
            {

            }
            catch (Exception)
            {

                throw;
            }
        }

    }
}
